<template>
  <el-dialog title="确定取消置顶该文章吗？" :visible.sync="ediHotNews.dialogVisible" size="tiny">
        <div v-loading="loading">
            <el-form>
                <div class="text-ag"></div>
            </el-form>
            <span slot="footer" class="dialog-footer">
                <el-row type="flex" class="row-bg" justify="center">
                    <el-col :span="4" class="mr"><el-button @click="ediHotNews.dialogVisible = false">取 消</el-button></el-col>
                    <el-col :span="4"><el-button type="primary" @click="confirm" >确 定</el-button></el-col>
                </el-row>
            </span>
        </div>
    </el-dialog>       
</template>
<script>
import { stickHeadLine } from "api/newTope";
export default {
  name: "ediHotNews",
  data() {
    return {
      dialogVisible: false,
      loading: false
    };
  },
  props: {
    ediHotNews: {
      type: Object,
      required: true
    }
  },
  methods: {
    confirm() {
      this.loading = true;
      stickHeadLine(this.ediHotNews.pId, this.ediHotNews.val)
        .then(data => {
          this.loading = false;
          this.ediHotNews.dialogVisible = false;
          this.$message({
            message: "设置成功！",
            type: "success"
          });
          this.$emit("setSon", "设置成功");
        })
        .catch(error => {
          this.laoding = false;
        });
    }
  }
};
</script>
<style lang="scss" scoped>
.text-ag {
  text-align: center;
  margin-bottom: 20px;
}
.mr {
  margin-right: 30px !important;
}
</style>
